package edu.chalmers.platypus.view.gui;

/**
 * Panel which shows logo and Start button.
 */
public class StartViewPanel extends javax.swing.JPanel {

    /** Constructor */
    public StartViewPanel() {
	initComponents();
    }

    /** Constructor */
    public StartViewPanel(PlatypusView parent) {
	this();
	this.parent = parent;
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed"
    // desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

	logoLabel = new javax.swing.JLabel();
	startButton = new javax.swing.JButton();

	setName("Form"); // NOI18N

	logoLabel.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
	org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application
		.getInstance().getContext()
		.getResourceMap(StartViewPanel.class);
	logoLabel.setIcon(resourceMap.getIcon("logoLabel.icon")); // NOI18N
	logoLabel.setText(resourceMap.getString("logoLabel.text")); // NOI18N
	logoLabel.setName("logoLabel"); // NOI18N

	startButton.setText(resourceMap.getString("startButton.text")); // NOI18N
	startButton.setName("startButton"); // NOI18N
	startButton.addActionListener(new java.awt.event.ActionListener() {
	    public void actionPerformed(java.awt.event.ActionEvent evt) {
		startButtonActionPerformed(evt);
	    }
	});

	javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
	this.setLayout(layout);
	layout.setHorizontalGroup(layout
		.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
		.addGroup(
			javax.swing.GroupLayout.Alignment.TRAILING,
			layout.createSequentialGroup()
				.addContainerGap()
				.addGroup(
					layout.createParallelGroup(
						javax.swing.GroupLayout.Alignment.TRAILING)
						.addComponent(
							startButton,
							javax.swing.GroupLayout.Alignment.LEADING,
							javax.swing.GroupLayout.DEFAULT_SIZE,
							411, Short.MAX_VALUE)
						.addComponent(
							logoLabel,
							javax.swing.GroupLayout.Alignment.LEADING,
							javax.swing.GroupLayout.DEFAULT_SIZE,
							411, Short.MAX_VALUE))
				.addContainerGap()));
	layout.setVerticalGroup(layout
		.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
		.addGroup(
			layout.createSequentialGroup()
				.addContainerGap()
				.addComponent(logoLabel,
					javax.swing.GroupLayout.DEFAULT_SIZE,
					194, Short.MAX_VALUE)
				.addPreferredGap(
					javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
				.addComponent(startButton,
					javax.swing.GroupLayout.PREFERRED_SIZE,
					45,
					javax.swing.GroupLayout.PREFERRED_SIZE)
				.addContainerGap()));
    }// </editor-fold>//GEN-END:initComponents

    private void startButtonActionPerformed(java.awt.event.ActionEvent evt) {// GEN-FIRST:event_startButtonActionPerformed
	parent.showNextView();
    }// GEN-LAST:event_startButtonActionPerformed

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel logoLabel;
    private javax.swing.JButton startButton;
    // End of variables declaration//GEN-END:variables

    private PlatypusView parent;

}
